#ifndef UTF8_H
#define UTF8_H

#include <stdint.h>

/*
 * This file contains function(s) that is(are) intent to achieve a better
 * capability of handling UTF-8 encoded chars. Since the content of
 * sina-twitter is store as UTF-8 encoded string, such capability helps
 * us to tell the decoded string contains Chinese chars. It will be helpful
 * to add right link for `@username' in the twitter and to make sure the link
 * add to the right text
 * */



/*
 * Return the position of the next leading byte in UTF8
 * encoded string.
 * */
unsigned char* next_utf8_char(unsigned char *utf8_string);

/*
 * Return the width of the first UTF8 char
 * in utf8_string, measure by byte.
 * Return 0 if it believe something is wrong.
 * */
int utf8_char_length(unsigned char* utf8_string);

/*
 * Return the code point (value) of the first
 * unicode char in the UTF8 encoded string.
 * */
uint64_t get_unicode_char(unsigned char *utf8_string);
#endif
